/*
    此处是业务EXCEL导入的方法接口调用维护
    用处：
    在表格组件内使用 import {方法名} from '@/api/business/wave' 进行调用
*/
import request from "@/utils/fetch";

// 定义公共的请求首部关键词
const PARENT_ADDRESS = "/excelImportField";

// 查询EXCEL导入字段 列表
export function selectExcelImportFieldList(data) {
  return request({
    url: PARENT_ADDRESS + `/selectExcelImportFieldList`,
    method: "POST",
    data: data,
  });
}

// 查询EXCEL导入字段 列表
export function insertExcelImportField(data) {
  return request({
    url: PARENT_ADDRESS + `/insertExcelImportField`,
    method: "POST",
    data: data,
  });
}

// 根据ID查询主子表
export function selectExcelImportFieldById(id) {
  return request({
    url: PARENT_ADDRESS + `/selectExcelImportFieldById/` + id,
    method: "POST"
  });
}

// 修改EXCEL导入字段
export function updateExcelImportField(data) {
  return request({
    url: PARENT_ADDRESS + `/updateExcelImportField/`,
    method: "POST",
    data: data
  });
}

// 获取 Excel 导入类型
export function getExcelImportType() {
  return request({
    url: `/querycodeLkup/ImportDataType`,
    method: "GET"
  });
}

// 验证导入类型
export function validateImportType(code) {
  return request({
    url: PARENT_ADDRESS + `/validateImportType/` + code,
    method: "GET"
  });
}

// 批量删除
export function deleteExcelImportFieldByIds(code) {
  return request({
    url: PARENT_ADDRESS + `/deleteExcelImportFieldByIds/` + code,
    method: "POST"
  });
}

// 定义公共的请求首部关键词
const PARENT_ADDRESS_01 = "/excelImportDefine";

// excel导入模板配置表-分页查询
export function queryExcelImportDefineByPage(data) {
  return request({
    url: PARENT_ADDRESS_01 + `/queryExcelImportDefineByPage`,
    method: "POST",
    data: data,
  });
}

// excel导入模板配置表-通过主键查询单条数据
export function queryExcelImportDefineById(id) {
  return request({
    url: PARENT_ADDRESS_01 + `/queryExcelImportDefineById/` + id,
    method: "POST"
  });
}

// excel导入模板配置表-新增数据
export function insertExcelImportDefine(data) {
  return request({
    url: PARENT_ADDRESS_01 + `/insertExcelImportDefine`,
    method: "POST",
    data: data,
  });
}

// excel导入模板配置表-编辑数据
export function updateExcelImportDefine(data) {
  return request({
    url: PARENT_ADDRESS_01 + `/updateExcelImportDefine/`,
    method: "POST",
    data: data,
  });
}

// excel导入模板配置表-删除数据
export function deleteExcelImportDefineById(id) {
  return request({
    url: PARENT_ADDRESS_01 + `/deleteExcelImportDefineById/` + id,
    method: "POST"
  });
}

// excel导入模板配置表-批量删除数据
export function batchDeleteExcelImportDefineByIds(ids) {
  return request({
    url: PARENT_ADDRESS_01 + `/batchDeleteExcelImportDefineByIds/` + ids,
    method: "POST"
  });
}

// 查找导入类型字段
export function findImportTypeField(code) {
  return request({
    url: PARENT_ADDRESS + `/findImportTypeField/` + code,
    method: "POST"
  });
}

// 导出模板
export function exportTemplate(id) {
  return request({
    url: PARENT_ADDRESS_01 + `/exportTemplate/` + id,
    method: "POST"
  });
}